﻿//初始化
if (typeof ($) != "undefined") {
    $(document).ready(function () {
        //获取员工姓名
        $("#EmpName").attr("disabled", true).css("background", "whitesmoke");
        GetEmpcodeByEmpID($("#EmployeeID").val());

        //获取提报人employeeId
        YAHOO.util.Connect.asyncRequest('POST', "../EHR/GetCurrentUser.aspx", {
            success: function (res) {
                try {
                    var str = res.responseText;
                    if (str != "-1") {
                        var token = str.split('_');
                        instance[0].EditWho = token[0];
                    }
                }
                catch (e) {
                }
                finally {

                }
            },
            failure: function (error) {
                alert("数据错误：" + error.statusText);
            }
        }, null);

    });
}
instance[0].EditDate = new Date();

//获取员工姓名
function GetEmpcodeByEmpID(empId) {
    var url = "../Extend/AjaxData/jsonlist.aspx?entity=V_hrEmployee&condition=ID='" + empId + "'";
    $.get(url, function (d, s) {
        var list = eval("(" + d + ")");
        for (var o in list.rows) {
            var t = list.rows[o].CName;
            if (typeof (t) != "undefined") {
                $("#EmpName").val(t);
            }
        }
    });
}

var fnCheckData = function () {
    try {

        if ($("#WorkDate").val() == "") {
            return "工作日不能为空！";
        }
    }
    catch (e)
     { }
}
